package com.zjdiepu.www.commpent.mapper.dz;

import javax.annotation.Resource;

import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.stereotype.Component;

import com.zjdiepu.www.base.core.BaseMapper;
import com.zjdiepu.www.base.enums.type.DataDicType;
import com.zjdiepu.www.commpent.RedisObjectClient;
import com.zjdiepu.www.model.base.dto.SimpleDataDictionary;
import com.zjdiepu.www.model.dz.dto.DzGps;

/**
 * 项目名称：diepu-parent-biz <br/> 
 * 类名称：DzGpsVoMapper <br/>  
 * 类描述： GPS加装 <br/>    
 * 创建人：xiongxiaotun <br/> 
 * 创建时间：2017年4月26日 下午5:29:32  <br/>   
 * 修改人：xiongxiaotun <br/> 
 * 修改时间：2017年4月26日 下午5:29:32   <br/>  
 * 修改备注：    <br/> 
 * @version V1.0   <br/>
 */
@Component
public class DzGpsVoMapper extends BaseMapper<DzGps>{

	@Resource
	private RedisObjectClient redisObjectClient;
	@Override
	public void mapper(RedisConnection redisConnection,DzGps m) {
		if(null == m) {
			return;
		}
		String companyGps = m.getCompanyGps();
		SimpleDataDictionary companyGpsDic = redisObjectClient.hGet(SimpleDataDictionary.class.getSimpleName(), companyGps, DataDicType.GPS_COMPANY.getCode());
		m.setCompanyGpsDisplay(companyGpsDic == null ? "" : companyGpsDic.getName());
		
	}

}
